package com.spring.boot.sample.test2.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;


/**
 * 自定义配置类：方式二  新增一个peoperties
 * 加载自定义配置，1.4之前使用@ConfigurationProperties(prefix = "wisely",locations
 ="classpath:config/wisely.properties")springBoot入口类加上@EnableConfigurationProperties
locations
1.5以上版本已经去掉，解决方式：采用@Component的方式注册为组件，
然后使用@PropertySource来指定自定义的资源目录，@EnableConfigurationProperties取
* <p>Title:WiselySettings </p>
* <p>Description: </p>
* <p>Company: </p> 
* @author kexl
* @date 下午3:44:26
 */
@Component
@ConfigurationProperties(prefix="wisely")
@PropertySource(value="classpath:config/wisely.properties")
public class WiselySettings {
	
	private String name;
	private String gender;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getGender() {
		return gender;
	}
	public void setGender(String gender) {
		this.gender = gender;
	}
	

}
